import { createRouter, createWebHashHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import routerConfig from './config'
const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: 'login',
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login/index.vue'),
  },
  {
    path: '/app',
    name: 'Home',
    redirect: '/app/index',
    component: () => import('@/views/Home/index.vue'),
    children: [
      {
        path: 'index',
        name: 'Index',
        component: () => import('@/views/Index/index.vue'),
      },
      {
        path: 'about',
        name: 'About',
        component: () => import('@/views/About/index.vue'),
      },
    ],
  },
]
const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

routerConfig(router)
export default router
